<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/web/header.jsp"%>
<title>用户登录</title>
</head>
<body>
	<div class="window">
		<fieldset class="layui-elem-field" style="margin: 25px;">
			<legend>登录</legend>
			<div class="layui-field-box">
				<form class="layui-form layui-form-pane">
					<div class="layui-form-item">
						<label class="layui-form-label">账号</label>
						<div class="layui-input-inline">
							<input type="text" name="code" placeholder="请输入账号"
								autocomplete="off" class="layui-input" lay-verify="required">
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">密码</label>
						<div class="layui-input-inline">
							<input type="password" name="pass" placeholder="请输入密码"
								autocomplete="off" class="layui-input" lay-verify="required">
						</div>
					</div>
					<input type="button" lay-submit lay-filter="login" value="登录" class="layui-btn" />
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<button type="button" class="layui-btn" onclick="goJspReg()">注册</button>
				<input type="hidden" name="action" value="login">
				</form>
			</div>
		</fieldset>
	</div>
	<script type="text/javascript">
	formSubmit('/employee','submit(login)','text',function(data){
		if(data==1){
			layer.msg("登录成功",{time:1000},function(){
				location.href=base.app+"/web/page/main.jsp"
			});
		}else if(data==2){
			layer.msg("密码错误")
		}else if(data==0){
			layer.msg("账号错误")
		}
	})
	function goJspReg(){
		location.href=base.app+"/web/reg.jsp"
	}
	</script>
</body>
</html>